﻿using FbHelperWP7NonUi.TextHelpers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace FbHelperNonUiTests
{
    [TestClass()]
    public class SimpleTextTest
    {
        private const string textEntry = "sdflsdhfjlsdhjlfhsdjlf";

        [TestMethod()]
        public void SimpleTextBasicTest()
        {
            SimpleText target = new SimpleText( textEntry );

            Assert.IsNotNull( target.Text );
            Assert.AreEqual( textEntry, target.Text );

            for (int count = 0; count < target.GetWordCount() + 1; count++)
            {
                StyledText styledText = target.CreateTextVisual( 0, 1 );
                Assert.IsNotNull( styledText );
                Assert.IsNotNull( styledText.Text );
            }
        }

        /// <summary>
        ///A test for EmptyParagraph
        ///</summary>
        [TestMethod()]
        public void EmptyParagraphTest()
        {
            SimpleText target = SimpleText.EmptyParagraph;
            Assert.IsNotNull( target );
            Assert.IsNotNull( target.Text );
            Assert.IsTrue( string.IsNullOrEmpty( target.Text ) );
            Assert.AreEqual( 1, target.GetWordCount() );

            StyledText styledText = target.CreateTextVisual( 0, 1 );
            Assert.IsNotNull( styledText );
        }
    }
}
